package com.zhuang.chapter04.polymorphism;

public class Main {

	public static void main(String[] args) {
		Animal animal;
		Dog dog = new Dog();
		animal=dog;
		// 接口回调
		animal.cry();
		animal.getName();
		System.out.println("-------------------------");
		Cat cat = new Cat();
		animal=cat;
		cat.cry();
		cat.getName();
		System.out.println("-------------------------");
		Simulator simulator = new Simulator();
		simulator.play(new Dog());
		simulator.play(new Cat());
	}

}
